<%-- 
    Document   : searchCauHoi
    Created on : Nov 7, 2013, 9:25:36 PM
    Author     : THANHLNSE60620
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Search</title>
    </head>
    <body>
        <h1>Search Page</h1>
        <form action="CauHoiServlet" method="POST">
            <table border="0">
                <tr>
                    <td>Date Send: </td>
                    <td><input type="text" name="txtDate" value=""><br/></td>
                </tr>
                <tr>
                    <td><input type="submit" value="Search" name="btAction"/></td>

                </tr>
            </table>
        </form>
    <c:if test="${not empty INFOR}">
        <table border="1">
            <thead>
                <tr>
                    <th>No.</th>
                    <th>Cau Hoi</th>
                    <th>Customer Code</th>
                    <th>Ngay Gui</th>
                </tr>
            </thead>
            <tbody>
            <c:forEach var="item" items="${INFOR}" varStatus="counter">
                <form action="CauHoiServlet">
                    <tr>
                        <td><a href="?btAction=Edit&txtId=${item.maCH}">${counter.count}</a></td>
                        <td>${item.cauHoi}</td>
                        <td>${item.customerCode}</td>
                        <td>${item.ngayGui}</td>
                        
                        <td>
                    <c:url var="delLink" value="CauHoiServlet">
                        <c:param name="id" value="${item.maCH}"></c:param>
                        <c:param name="btAction" value="Delete"></c:param>
                        <c:param name="searchQueryString" value="${param.txtDate}"></c:param>
                    </c:url>
                    <a href="${delLink}">Delete</a>
                    </td>
                    </tr>
                </form>
            </c:forEach>
            </tbody>
        </table>
    </c:if>
</body>
</html>
